﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    interface IUSB
    {
        void read();
        void write();
    }
    class ComputerAndUSB
    {
        private string _brand;
        private IUSB _usb1;
        private IUSB _usb2;

        public string brand { get => this._brand; set => this._brand = value; }
        public IUSB usb1 { get => this._usb1; set => this._usb1 = value; }
        public IUSB usb2 { get => this._usb2; set => this._usb2 = value; }

        public ComputerAndUSB()
        {

        }
        public ComputerAndUSB(string brand)
        {
            this._brand = brand;
        }
        public void start()
        {
            Console.WriteLine("{0}电脑开机中", this._brand);
        }
        public void end()
        {
            Console.WriteLine("{0}电脑关机中", this._brand);
        }
        public void ReadData()
        {
            usb1.read();
            usb2.read();
        }

        public void WriteData()
        {
            usb1.write();
            usb2.write();
        }
    }
    class Disk
    {
        private string _brand;

        public string brand { get => this._brand; set => this._brand = value; }

        public Disk(string brand)
        {
            this._brand = brand;
        }

        public Disk()
        {
        }
    }
    class MobileHardDisk : Disk, IUSB
    {
        public void read()
        {
            Console.WriteLine("{0}品牌的移动硬盘在读取数据中...", this.brand);
        }

        public void write()
        {
            Console.WriteLine("{0}品牌的移动硬盘正在写入数据中...", this.brand);
        }
        public MobileHardDisk(string brand) : base(brand)
        {

        }

    }
    class UDisk : Disk, IUSB
    {
        public void read()
        {
            Console.WriteLine("{0}品牌的U盘在读取数据中...", this.brand);
        }

        public void write()
        {
            Console.WriteLine("{0}品牌的U盘正在写入数据中...", this.brand);
        }

        public UDisk(string brand) : base(brand)
        {

        }
    }
}
